﻿using System;
using GdNet.WebFramework.Domain.Repositories.System;
using GdNet.WebFramework.Domain.System;

namespace GdNet.Applications.DataGeneration.DataAssistants
{
    public static class ModuleAssistant
    {
        public static void GeneratedSampleModules(IModuleRepository moduleRepository)
        {
            Console.WriteLine("Generating modules...");

            var cmsModule = Module.Factory.Create("cms", "Content Management", "GdNet.WebFramework.Modules.ContentManagement");
            cmsModule.AddAction(ModuleAction.Factory.Create("al", "Admin list items", "Admin/ListItem.cshtml", "GdNet.WebFramework.Modules.ContentManagement.Actions.AdminListContentItemAction"));
            cmsModule.AddAction(ModuleAction.Factory.Create("ad", "Admin detail item", "Admin/DetailItem.cshtml", "GdNet.WebFramework.Modules.ContentManagement.Actions.AdminDetailContentItemAction"));

            moduleRepository.Save(cmsModule);
        }
    }
}
